package com.tbit.uqbike.object.pojo;

import com.tbit.common.entity.BaseEntity;
import com.tbit.uqbike.annos.Excel;
import lombok.*;

import java.util.Date;
import java.util.Map;

/**
 * 用户购买套餐日志对象 user_meal_log
 *
 * @author jing
 * @date 2021-05-25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class UserMealLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Integer logId;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 用户号码
     */
    @Excel(name = "手机号", sort = 1)
    private String phone;

    /**
     * 套餐id
     */
    private Integer mealId;

    @Excel(name = "优惠券名称", sort = 2)
    private String name;

    /**
     * 品牌ID
     */
    private Integer accountId;

    /**
     * 购买金额
     */
    private Integer price;

    @Excel(name = "优惠券价格(元)", sort = 3)
    private String priceYuan;

    /**
     * 添加时间
     */
    @Excel(name = "购买时间", width = 30, dateFormat = "yyy-MM-dd HH:mm:ss", sort = 4)
    private Date addTime;

    private String startTime;

    private String endTime;

    private String beginTime;

    private Map<String, Object> params;

    /**
     * 单位转换
     */
    public void unitConversion() {
        this.priceYuan = String.format("%.2f", ((double) price / 100D));
    }


}
